package com.sgj.service.impl;

import com.sgj.entity.User;
import com.sgj.mapper.UserMapper;
import com.sgj.service.UserService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import java.util.Objects;

/**
 * <p>
 * 用户表 服务实现类
 * </p>
 *
 * @author ${author}
 * @since 2021-12-16
 */
@Service
public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements UserService {

    @Override
    public User login(User user) {
        User login = baseMapper.login(user);
        if (Objects.isNull(login)) {
            throw new RuntimeException("登陆失败");
        }
        return login;
    }
}